
package com.yesep.learn.mqtt.client.handler.protocol;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.yesep.learn.mqtt.client.common.event.EventType;
import com.yesep.learn.mqtt.client.common.util.ChannelUtil;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.mqtt.MqttPubAckMessage;

/**
   * 消息编号：4
 * @Description: 发布应答
 */
public class PubAck {

	private static final Logger logger = LoggerFactory.getLogger(PubAck.class);

	public void process(ChannelHandlerContext ctx, MqttPubAckMessage message) {
		ChannelUtil.triggerUserEvent(ctx, EventType.PUBLISH_SUCCESS, message);
		logger.info("publish success : {}", ChannelUtil.clientId(ctx.channel()));
	}

}
